import $ from 'https://cdn.skypack.dev/blingblingjs';

$('.demo').forEach(demo => {
  demo.addEventListener('animationend', e => {
    const $target = $(e.target);
    let txn = $target.attr('transition-style');

    $target.attr('transition-style', txn.includes('out') || $('#stop')[0].checked ?
    txn.replace('out', 'in') :
    txn.replace('in', 'out'));
  });
});